<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the parameter to the specified value</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="solrparams.set.html">SolrParams::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="solrparams.tostring.html">SolrParams::toString</a></div>
 <div class="up"><a href="class.solrparams.html">SolrParams</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="solrparams.setparam" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SolrParams::setParam</h1>
  <p class="verinfo">(PECL solr &gt;= 0.9.2)</p><p class="refpurpose"><span class="refname">SolrParams::setParam</span> &mdash; <span class="dc-title">Sets the parameter to the specified value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-solrparams.setparam-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="class.solrparams.html" class="type SolrParams">SolrParams</a></span> <span class="methodname"><strong>SolrParams::setParam</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
   )</div>

  <p class="para rdfs-comment">
   Sets the query parameter to the specified value. This is used for parameters that can only be specified once. Subsequent calls with the same parameter name will override the existing value
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-solrparams.setparam-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">name</code></em></dt>

     <dd>

      <p class="para">
       Name of the parameter
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">value</code></em></dt>

     <dd>

      <p class="para">
       Value of the parameter
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-solrparams.setparam-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a SolrParam object on success and <strong><code>FALSE</code></strong> on value.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-solrparams.setparam-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4631">
    <p><strong>Example #1 <span class="methodname"><strong>SolrParams::setParam()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$param&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SolrParams</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$param</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setParam</span><span style="color: #007700">(</span><span style="color: #DD0000">'q'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'solr'</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">setParam</span><span style="color: #007700">(</span><span style="color: #DD0000">'rows'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>


</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="solrparams.set.html">SolrParams::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="solrparams.tostring.html">SolrParams::toString</a></div>
 <div class="up"><a href="class.solrparams.html">SolrParams</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
